<?php defined('IN_LK') or die('Access Denied');?>
<?php include self::admin_t('header', 'admin');?>

<ul class="main_nav">
  <li><a class="select" target="_self" href="?m=member&c=member_group&a=manage">会员组管理</a></li>
  <li><a target="_self" href="javascript:void(0);" onclick="add_member_group()">添加会员组</a></li>
</ul>
<div class="c"></div>
<div class="table-list">
<form action="?m=member&c=member_group&a=listorder" method="post">
<div class="table-list">
  <table width="100%" cellspacing="0">
    <thead>
      <tr>
        <th width="60">序号</th>
        <th width="70">排序</th>
        <th align="left" width="80">会员组名</th>
        <th  width="60">系统组</th>
        <th  width="60">积分上限</th>
        <th width="">允许发布</th>
        <th width="">允许短消息</th>
        <th width="">允许搜索</th>
        <th width="">允许上传附件</th>
        <th>会员数</th>
        <th width="80">操作</th>
      </tr>
    </thead>
    <tbody>
    <?php 
	if($grouplist)
	{
		foreach($grouplist as $groupinfo)
		{
	?>
    <tr>
        <td align="center"><?php echo $groupinfo['groupid'];?></td>
        <td align="center"><input type="text" class="input input_short input_short_center" name="listorder[<?php echo $groupinfo['groupid']?>]" value="<?php echo $groupinfo['listorder'];?>" size="3" /></td>
        <td><?php echo $groupinfo['name'];?></td>
        <td align="center"><?php if($groupinfo['issystem']){?><span class="green">√</span><?php }else{?><span class="red">×</span><?php }?></td>
        <td align="center"><?php echo $groupinfo['point'];?></td>
        <td align="center"><?php if($groupinfo['allowpost']){?><span class="green">√</span><?php }else{?><span class="red">×</span><?php }?></td>
        <td align="center"><?php if($groupinfo['allowmessage']){?><span class="green">√</span><?php }else{?><span class="red">×</span><?php }?></td>
        <td align="center"><?php if($groupinfo['allowsearch']){?><span class="green">√</span><?php }else{?><span class="red">×</span><?php }?></td>
        <td align="center"><?php if($groupinfo['allowattachment']){?><span class="green">√</span><?php }else{?><span class="red">×</span><?php }?></td>
        <td align="center"><?php echo $groupinfo['totalnum']?></td>
        <td align="center"><a href="javascript:void(0);" onclick="edit(<?php echo $groupinfo['groupid'];?>, '<?php echo $groupinfo['name'];?>');">编辑</a></td>
    </tr>
	<?php
		}
	}
	else
	{
	?>
      <tr>
      	<td colspan="6" align="center">暂无数据</td>
      </tr>
    <?php
	}
	?>
    </tbody>
  </table>
  </div>
  <div class="bot">
  	<input type="submit" class="btn" name="dosubmit" id="dosubmit" value="排序" />
  </div>
</form>
</div>
<?php include self::admin_t('footer', 'admin');?>
<script type="text/javascript">
function add_member_group()
{
	var url = '?m=member&c=member_group&a=add';
	window.top.art.dialog(
	{
		title : '添加会员组',
		iframe: url,
		width : 700,
		height: 500,
		id    : 'add_member_group'
	},
	function ()
	{
		var d    = window.top.art.dialog({id:'add_member_group'}).data.iframe;
		var form = d.document.getElementById('dosubmit');
		form.click();
		return false;
	},
	function ()
	{
		window.top.art.dialog({id:'add_member_group'}).close();
	});
}
function edit(id, name)
{
	var url = '?m=member&c=member_group&a=edit&groupid=' + id;
	window.top.art.dialog(
	{
		title  :'编辑 - ' + name,
		iframe : url,
		width  :700,
		height : 500,
		id     : 'edit'
	},
	function()
	{
		var d    = window.top.art.dialog({id:'edit'}).data.iframe;
		var form = d.document.getElementById('dosubmit');
		form.click();
		return false;
	},
	function ()
	{
		window.top.art.dialog({id:'edit'}).close();
	});
}
</script>
